<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <link rel="shortcut icon" href="/juanpao.ico"/>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <title>在线客服系统</title>
    <!--加载引用文件 -->
    {/* 载入框架&插件CSS */}
    {load href="__libs__/layer/skin/layer.css"/}
    {load href="__libs__/amaze/css/amazeui.min.css"/}
    {/* 载入框架&插件JS */}
    {load href="__libs__/jquery/jquery.min.js"/}
    {load href="__libs__/layer/layer.js"/}
    {load href="__libs__/amaze/js/amazeui.min.js"/}
    {/* 载入项目 CSS & JS */}
    {load href="__style__/admin/login.css"/}
    {load href="__style__/admin/reload.css"/}
    {load href="__script__/admin/message.js"/}
    <script type="text/javascript" src="__script__/admin/login.js?v=1.2"></script>
</head>
<style>
    a {
        color: black;
    }

    a:hover {
        color: black;
    }

    .am-form-icon {
        text-align: center;
        margin-top: 40px;
    }
</style>

<body style="background: rgb(247, 246, 246);">
<div class="header" style="top:0;width:100%;height: 60px;z-index: 10000;box-shadow: 0 0 1px #ccc;background: #fff;">
    <div class="logo" style="position: absolute;left: 120px;top:10px;">
        <a href="https://www.wolive.cc">
            <img src="__image__/index/juanpao_logo.png" width="40px" style="border-radius: 10px;"/>
        </a>
    </div>
    <div class="title-name" style="position: absolute;left: 170px;top: 15px;font-size: 20px;">
        <a href="https://www.wolive.cc">客服系统</a>
    </div>
    <div class="connect" style="position: absolute;right: 120px;top: 20px;font-size: 10px;">

    </div>
</div>


<div id="login-container" class="container"
     style="border:1px solid #ddd; box-shadow: rgba(15, 66, 76, 0.25) 0px 0px 24px 0px;margin:0 auto;padding: 10px;background: #fff;border-radius: 8px;max-width: 100%;">
    <div id="login-title">客服登录平台</div>
    <div class="am-form-group am-form-icon">
        登录中......
    </div>
</div>

<script>
    var str = window.location.search.substring(1);
    str = str.split('&');
    var loginArr = [];
    for (var i = 0; i < str.length; i++) {
        var arr = str[i].split('=');
        loginArr[arr[0]] = arr[1]
    }
    var subData = {
        username: loginArr['u'],//当前登录人账号
        password: loginArr['p'],//当前登陆人密码
        is_merchant: 1//是否直接跳转客服
    };
    $.ajax({
        url: '{:url("admin/login/check")}',
        type: 'post',
        data: subData,
        dataType: 'json',
        success: function (res) {
            //如果登录不成功，弹出提示，否则跳转首页
            if (!res.code) {
                layer.msg(res.msg, {icon: 1, time: 1000});
                return;
            }
            location.href = '/admin/index/index';
        },
        error: function () {
            layer.msg('出错啦', {icon: 1, time: 1000});
        }
    })
</script>
</body>
</html>

